/**
 * 手机号绑定相关接口
 */
import { request } from '@/utils/request';

/**
 * 发送短信验证码
 * @param data { mobile: string }
 */
export function sendSmsCode(data: any) {
  return request(
    'plugin.breed-game.frontend.mobile-bind.sendSms',
    {
      method: 'POST',
      param: data
    }
  );
}

/**
 * 绑定手机号
 * @param data { user_id: number, mobile: string, code: string }
 */
export function bindUserMobile(data: any) {
  return request(
    'plugin.breed-game.frontend.mobile-bind.bindMobile',
    {
      method: 'POST',
      param: data
    }
  );
}

/**
 * 检查手机号是否已被绑定
 */
export function checkMobileExists(data: any) {
  return request(
    'plugin.breed-game.admin.work.user.checkMobile',
    {
      method: 'POST',
      param: data
    }
  );
}

